Skip to content

fix(BudgetTerm.f90): ensure that the size of an array is >0 before deallocating#1815

Open
emorway-usgs wants to merge 10 commits into
MODFLOW-ORG:developfrom
emorway-usgs:fix_sft
Open

fix(BudgetTerm.f90): ensure that the size of an array is >0 before deallocating#1815
emorway-usgs wants to merge 10 commits into
MODFLOW-ORG:developfrom
emorway-usgs:fix_sft

Conversation

@emorway-usgs
Copy link
Copy Markdown
Contributor

  • Fix offered in BudgetTerm was discovered using models that included only a single SFT/SFE reach. Previously, GWF models with a single SFR reach would work. Only transport models would fail.
  • 2 new autotests offered that each use only a single reach
    • The first autotest is for a GWT model (test_gwt_uztmvt2x1). This test ensures that in addition to a single reach, a single MVT connection between UZT and SFT works as expected
    • The 2nd autotest is for a GWE model (test_gwe_drycell_cnd3). This test checks that conduction between SFE and a dry host cell is working as expected in a single-reach model
  • Extended an existing single-reach SFR autotest to include SFT. Prior to this fix, the added GWT model with a single SFT reach would fail because of the bug.
  • Brief description of bug offered in release notes
  • fprettify
  • black

@emorway-usgs emorway-usgs force-pushed the fix_sft branch 3 times, most recently from 7cdf52f to 07f53e6 Compare May 22, 2024 23:17
@emorway-usgs emorway-usgs changed the title fix(BudgetTerm.f90): ensure that the size of an array is >0 before attempting to deallocate fix(BudgetTerm.f90): ensure that the size of an array is >0 before deallocating May 23, 2024
@emorway-usgs emorway-usgs force-pushed the fix_sft branch 6 times, most recently from 238bc44 to 3bfd57e Compare June 21, 2024 23:18
@emorway-usgs emorway-usgs force-pushed the fix_sft branch 5 times, most recently from b42469e to e216987 Compare July 9, 2024 17:36
@emorway-usgs emorway-usgs force-pushed the fix_sft branch 4 times, most recently from 61f642a to 84b1333 Compare July 19, 2024 15:07
@emorway-usgs emorway-usgs force-pushed the fix_sft branch 3 times, most recently from e627f22 to 37a4d61 Compare August 6, 2024 19:22
@emorway-usgs emorway-usgs force-pushed the fix_sft branch 2 times, most recently from 6286915 to 111398d Compare August 14, 2024 16:35
@christianlangevin
Copy link
Copy Markdown
Contributor

I remember glancing at this a while back. I think I understand that you are intending to not write any flows for the single reach case and instead remove the flowjaface record entirely. I wonder if this is the best way to handle it. Perhaps it would be better to still include the header but just not write any records? I'm thinking that this may break other downstream processors, like zone budget. Do we have a similar problem for LAK/MAW/UZF? Can you remind me why this is a problem for SFT but not SFR (I think we discussed this once before).

@emorway-usgs
Copy link
Copy Markdown
Contributor Author

I will need to refamiliarize myself with the issue. As I recall from reading my previous notes, I think the issue had something to do with the flowjaface budget term in single reach models (meaning its not needed). The transport model was either (1) not expecting this budget term and it was present, thereby throwing off the indexing or (2) was expecting this budget term and it was missing by virtue of there being no connected reaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants